package com.relytosoft.mizar.analyze.face.services.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.relytosoft.mizar.analyze.face.api.entity.AyFaceTask;
import com.relytosoft.mizar.analyze.face.api.entity.AyFaceTaskSon;
import com.relytosoft.mizar.analyze.face.api.pojo.query.AyFaceTaskSonQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author lj
 * @date 2022/5/16 11:38
 */
@Mapper
public interface AyFaceTaskSonMapper extends BaseMapper<AyFaceTaskSon> {


    /**
     * 分页条件查询子任务信息
     *
     * @param page          分页参数
     * @param ayFaceTaskSon 子任务信息
     * @return 子任务分页信息
     */
    Page<AyFaceTask> selectPageTaskList(@Param("page") Page<AyFaceTask> page, @Param("ayFaceTaskSon") AyFaceTaskSon ayFaceTaskSon);

    /**
     * 根据设备id查询是否有未删除的任务
     *
     * @param cameraId
     * @return
     */
    Integer selectTaskSonById(@Param("cameraId") String cameraId);

    /**
     * 分页查询子任务列表
     *
     * @param page
     * @param ayFaceTaskSonQuery
     * @return
     */
    Page<AyFaceTaskSon> selectPageTaskSonList(@Param("page") Page<AyFaceTaskSon> page, @Param("ayFaceTaskSonQuery") AyFaceTaskSonQuery ayFaceTaskSonQuery);

    /**
     * 查询子任务id
     *
     * @param ayFaceTaskId
     * @return
     */
    List<Integer> selectSonIds(@Param("ayFaceTaskId") Integer ayFaceTaskId);

    /**
     * 查询子任务状态
     *
     * @param ayFaceTaskId
     * @return
     */
    List<Integer> selectStatusList(@Param("ayFaceTaskId") Integer ayFaceTaskId);

    /**
     * 通过任务ID查找子任务
     *
     * @param taskID
     * @return
     */
    AyFaceTaskSon getByTaskId(@Param("taskId") String taskID);

}
